package com.itaem.community.modules.infrastructure.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itaem.community.modules.infrastructure.user.dto.UserDTO;
import com.itaem.community.modules.infrastructure.user.entity.UserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;

/**
 * <p>
 * 用户信息 Mapper 接口
 * </p>
 *
 * @author tomato
 * @since 2020-10-28
 */
@Component
@Mapper
public interface UserDAO extends BaseMapper<UserEntity> {

    /**
     * 多表inner查询
     *
     * @param page 分页条件
     * @return 多表联查分页数据
     */
    Page<UserDTO> listUsers(Page page);

    /**
     * 根据用户id查询用户信息
     *
     * @param userId 用户id
     * @return 用户信息
     */
    UserDTO getUser(Integer userId);
}
